/* Appointment Management Styles */

.appointment-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    height: calc(100% - 60px); /* Account for header */
}

/* Tabs Styling */
.appointment-tabs {
    display: flex;
    background-color: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.appointment-tabs .tab {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    flex: 1;
    color: #666;
    font-weight: 500;
    border-bottom: 3px solid transparent;
}

.appointment-tabs .tab.active {
    background-color: #fff;
    color: #4a89dc;
    border-bottom: 3px solid #4a89dc;
    font-weight: 600;
}

.appointment-tabs .tab:hover:not(.active) {
    background-color: #eaeaea;
    color: #555;
}

/* Tab Content */
.tab-content {
    display: none;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
    flex-grow: 1;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Calendar View */
#calendar-view {
    display: none;
    flex-direction: row;
    gap: 20px;
    height: 100%;
}

#calendar-view.active {
    display: flex;
}

.calendar-container {
    flex: 3;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 15px;
}

.calendar-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.weekday {
    text-align: center;
    font-weight: 600;
    color: #666;
    padding: 8px 0;
    font-size: 0.9rem;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 8px;
    flex-grow: 1;
}

.calendar-day {
    position: relative;
    height: 0;
    padding-bottom: 100%;
    background: #f9f9f9;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-day.other-month {
    background: #f0f0f0;
    color: #aaa;
}

.calendar-day.today {
    background: #e6f3ff;
    border: 2px solid #4a89dc;
}

.calendar-day.selected {
    background: #4a89dc;
    color: white;
}

.calendar-day.has-appointments:after {
    content: '';
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fc6c85;
}

.calendar-day.selected.has-appointments:after {
    background: white;
}

.day-number {
    position: absolute;
    top: 10%;
    left: 10%;
    font-size: 0.9rem;
    font-weight: 500;
}

.appointment-dot-container {
    position: absolute;
    bottom: 20%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 3px;
}

.appointment-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.appointment-dot.confirmed {
    background: #4caf50;
}

.appointment-dot.pending {
    background: #ff9800;
}

.day-appointments {
    flex: 2;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}

.day-appointments h3 {
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 1.2rem;
    color: #333;
}

.day-appointment {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    border-left: 4px solid #4a89dc;
    position: relative;
}

.day-appointment:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.day-appointment.pending {
    border-left-color: #ff9800;
}

.day-appointment.confirmed {
    border-left-color: #4caf50;
}

.day-appointment.cancelled {
    border-left-color: #f44336;
    opacity: 0.7;
}

.day-appointment .status-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.pending {
    background: #fff3e0;
    color: #e65100;
}

.status-badge.confirmed {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.cancelled {
    background: #ffebee;
    color: #c62828;
}

.status-badge.completed {
    background: #e8eaf6;
    color: #3f51b5;
}

/* Appointment List View */
.appointment-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    overflow-y: auto;
}

.appointment-card {
    display: flex;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: all 0.3s ease;
}

.appointment-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.appointment-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: #4a89dc;
    color: white;
    width: 90px;
    text-align: center;
}

.appointment-date .month {
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
}

.appointment-date .day {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
}

.appointment-date .time {
    font-size: 0.9rem;
    margin-top: 5px;
}

.appointment-info {
    flex-grow: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.appointment-info .doctor-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.doctor-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.appointment-info .doctor-name {
    font-weight: 600;
    color: #333;
}

.appointment-info .doctor-specialty {
    font-size: 0.85rem;
    color: #666;
}

.appointment-info .appointment-type {
    font-size: 0.9rem;
    color: #555;
}

.appointment-info .appointment-location {
    font-size: 0.9rem;
    color: #555;
    display: flex;
    align-items: center;
    gap: 5px;
}

.appointment-info .appointment-location i {
    color: #4a89dc;
}

.appointment-info .appointment-notes {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.appointment-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border-top: 1px solid #f0f0f0;
    background-color: #fafafa;
}

.card-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Actions Bar */
.appointment-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: #4a89dc;
    outline: none;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* Doctor selection */
.doctor-selection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.doctor-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
}

.doctor-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.doctor-card.selected {
    border-color: #4a89dc;
    box-shadow: 0 0 0 2px rgba(74, 137, 220, 0.3);
}

.doctor-card-header {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.doctor-card-header img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

.doctor-card-header h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
}

.doctor-card-header p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

.doctor-card-body {
    padding: 10px 15px;
    font-size: 0.85rem;
}

.doctor-card-body .info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.doctor-card-body .info-label {
    color: #888;
}

.doctor-card-body .info-value {
    font-weight: 500;
    color: #333;
}

.time-slot-selection {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.time-slot {
    padding: 10px;
    text-align: center;
    background: #f5f5f5;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.time-slot:hover {
    background: #e0e0e0;
}

.time-slot.selected {
    background: #4a89dc;
    color: white;
}

.time-slot.unavailable {
    opacity: 0.5;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    color: #666;
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #4a89dc;
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.empty-state i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin: 0 0 10px 0;
    color: #555;
}

.empty-state p {
    margin: 0 0 20px 0;
    color: #888;
    max-width: 400px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #calendar-view {
        flex-direction: column;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .doctor-selection {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .time-slot-selection {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .appointment-tabs .tab {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .appointment-card {
        flex-direction: column;
    }
    
    .appointment-date {
        width: 100%;
        padding: 10px;
        flex-direction: row;
        justify-content: space-around;
    }
    
    .doctor-selection {
        grid-template-columns: 1fr;
    }
    
    .time-slot-selection {
        grid-template-columns: repeat(2, 1fr);
    }
}
